<!--党务排名-->
<template>
  <section class="page">
    <headerbar>{{ title }}完成率排行榜
    </headerbar>
    <section class="self-height">
      <section class="block">
        <section class="list-table">
          <div class="item">
            <span class="icon">排名</span>
            <span class="max-my">党（工）委</span>
            <span>完成率</span>
          </div>
          <div :class="(userInfo.dgwGroupId === item.groupId) ? 'red':''" class="item" v-for="(item,index) in swipeData">
            <span>{{ index + 1 }}</span>
            <span class="max-my">{{ item.groupName }}</span>
            <span>{{ item.completeRate }}%</span>
          </div>
          <div class="text-center no-data" v-if="swipeData.length===0">
            <img src="../../../../static/images/no_data.png" alt="">
            <p>暂无数据</p>
          </div>
        </section>
        <div class="pdv-3"></div>
        <div class="pdv-3"></div>
        <div class="pdv-3"></div>
        <div class="pdv-3"></div>
      </section>
    </section>
  </section>
</template>

<script>
import loginService from '@/service/loginService'
import tools from '@/utils/tools'
export default {
  name: "partyAffairsRanking",
  data() {
    return {
      title: '支部大会排行榜',
      type:'',
      swipeData: [
        {
          "groupId":"999019",
          "groupName":"贵阳孔学堂文化传播中心党委",
          "completeNum":0,
          "completeRate":33.33,
          "rank":1
        },],
      userInfo: {}
    }
  },
  created() {
    this.userInfo = this.$localStorage.get('userInfo')
    console.log('this.userInfo',this.userInfo);
    this.title = this.$route.query.title
    this.type = this.$route.query.type
    this.getDgwRank()
  },
  methods:{
    getDgwRank(){
      let data={
        "dataQuarter": "",
        "dataYear": "",
        "type":this.type
      }
      loginService.dgwRank(data).then((res) => {
        if (res.code !== 0) {
          return tools.tip(res.message)
        }
        this.swipeData = res.data
      });
    },
  },

}
</script>

<style scoped lang="scss">
@import "@/common/stylus/moon.scss";
</style>
